from flask_restful import fields

from db import db


resoure_fields = {
    'teacher_id': fields.Integer,
    'teacher_name': fields.String,
    'teacher_sex':fields.String,
    'teacher_account':fields.String,
    'teacher_title':fields.String,
    'teacher_phone':fields.String,
    'is_admin':fields.Boolean,
    'teacher_password':fields.String,

    }

class Teacher(db.Model):
    __tablename__ = "teacher"
    teacher_id = db.Column('teacher_id',db.Integer,primary_key=True)
    teacher_name = db.Column('teacher_name',db.String)
    teacher_sex = db.Column('teacher_sex',db.String)
    teacher_account = db.Column('teacher_account',db.String)
    teacher_password = db.Column('teacher_password',db.String)
    teacher_title = db.Column('teacher_title',db.String)
    teacher_phone = db.Column('teacher_phone',db.String)
    is_admin = db.Column('is_admin',db.Boolean)




# class Emp(db.Model):
#     # 指定数据库中关联的表名，如果与类名一致可以不定义
#     __tablename__ = "emp"
#     # 分别指定类中的属性与表中字段的对应关系，如果属性名称和表字段名称一致，可以省略第一个参数
#     empno = db.Column('empno',db.Integer,primary_key=True)
#     ename = db.Column('ename',db.String)
#     job = db.Column('job', db.String)
#     mgr = db.Column('mgr', db.Integer)
#     hiredate = db.Column('hiredate', db.Date)
#     sal = db.Column('sal', db.Float)
#     comm = db.Column('comm', db.Float)
#     deptno = db.Column('deptno',db.Integer)
#
# class Dept(db.Model):
#     __tablename__ = "dept"
#     deptno = db.Column('deptno', db.Integer, primary_key=True)
#     dname = db.Column('dname', db.String)
#     loc = db.Column('loc', db.String)